package com.waleipt.api.es.tcptransport.message;

import java.io.IOException;

import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.transport.TransportResponse;

public class UserResponse extends TransportResponse
{
    public int status ;
    public String reason ;
    
    public UserResponse(){}
    
    public UserResponse( int status, String reason )
    {
        this.status = status ;
        this.reason = reason ;
    }
    
    @Override
    public void readFrom(StreamInput in) throws IOException {
//        super.readFrom(in);
        this.status = in.readInt() ;
        this.reason = in.readString();
    }
    
    @Override
    public void writeTo(StreamOutput out) throws IOException {
//        super.writeTo(out);
        out.writeInt( this.status );
        out.writeString( this.reason );
    }
}